package bea.cliente.character;

import bea.cliente.core.Game;
import com.jme3.input.InputManager;
import com.jme3.input.MouseInput;
import com.jme3.input.controls.MouseButtonTrigger;

/**
 *
 * @author Ivan
 */
public class Player extends Character {
    // ouvinte de eventos de entrada
    private CharacterAction actions;

    public Player() {
        super();
        actions = new CharacterAction(this);
    }

    public void initPlayer(Game game) {
        super.initCharacter(game);
        //initKeys(game.getInputManager());
        initMouse(game.getInputManager());
    }

    @Override
    public void update(float tpf) {
        super.update(tpf);

    }

    private void initKeys(InputManager inputManager) {
        // não implementado
    }

    private void initMouse(InputManager inputManager) {
        System.out.println("addAction");
        inputManager.addListener(actions, CharacterAction.LEFT_CLICK);
        inputManager.addMapping(CharacterAction.LEFT_CLICK, new MouseButtonTrigger(MouseInput.BUTTON_LEFT));
    }
}
